function isEmpty(obj) {
	if (obj == null || obj == undefined || jQuery.trim(obj).length == 0 || obj == "") {
		return true;
	}
	return false;
} 

/**
 * 验证传入值
 * 
 * @author Wangyu
 * @param str
 *            input value
 * @param min
 *            min length
 * @param max
 *            max length
 * @param type
 *            (只含有下面说明的) 
 *            0代表含有数字 
 *            a代表含有小写字母 
 *            A代表含有大写字母 
 *            _代表含有下划线
 *            E或e代表邮箱验证
 *            C表示中文
 * @return true:正确 false:错误
 */
function validateInput(str, min, max, type) {
	
	if (isEmpty(str)) {
		return false;
	}
	var len = jQuery.trim(str).length;
	if (len < min || len > max) {
		return false;
	}
	
	var vali = "/^[";
	if (type.indexOf("0") != -1) {
		vali += "0-9";
		
	}
	if (type.indexOf("a") != -1) {
		vali += "a-z";
	}
	if (type.indexOf("A") != -1) {
		vali += "A-Z";
	}
	if(type.indexOf("C" != -1)){
		
		vali +="\u4E00-\u9FA5\uF900-\uFA2D";
	}
	if (type.indexOf("_") != -1) {
		vali += "_";
	} 
	vali += "]{"+min+","+max+"}";
	vali += "$/";
	if (type == "e" || type == "E" ) {
		vali = "/^([a-zA-Z0-9_\-]+)@([a-zA-Z0-9_\-])+((\.[a-zA-Z0-9_\-]{2,3}){1,2})$/";
		
	}
	var patrn = eval(vali);
	if (!patrn.exec(str))
		return false;
	return true;
}

